home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q32479 < prev    next >
Text File  |  1988-07-21  |  1KB  |  52 lines

  1. Q32479 Incorrect Code Generated for Nested Intrinsics
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.    The code generated for the following example is incorrect when it
  8. is compiled with the options /AL /Oil. The DS register is not restored
  9. after the call to strcpy, which causes subsequent data accesses within
  10. the loop to be incorrect.
  11.    Microsoft has confirmed this to be a problem in Version 5.10
  12. of the C compiler. We are researching this problem and will post new
  13. information as it becomes available.
  14.    You can work around this problem by declaring the variable L to be
  15. int rather than register.
  16.  
  17. More Information:
  18.    The following is an example:
  19.  
  20. #include <stdio.h>
  21. struct billrec
  22.    {
  23.    char     invoicebody[20][52];
  24.    } ;
  25.  
  26. struct billrec  invoice;
  27.  
  28.  int  column;
  29.  
  30. static char textbody[20][80];
  31. void edit_text( )
  32.  
  33. {
  34.  
  35. register int i;
  36. register int L;
  37.  
  38. for ( i = 0; i < 20; i++ )
  39.    {
  40.    memset(textbody[i], NULL, 80);
  41.    if ( strlen(invoice.invoicebody[i]) )
  42.        strcpy(textbody[i], invoice.invoicebody[i]);
  43.    }
  44.              column = L + 11 + 1;
  45. }
  46.  
  47.  
  48.  
  49.  
  50. Keywords:  buglist5.10 qfbv
  51. Updated  88/07/21 03:19
  52.